
#ifndef __APTCAB_RECORD_LOCATION_HPP_2010__
#define __APTCAB_RECORD_LOCATION_HPP_2010__

#include <sys/types.h>

#include <sstream>
#include <string>


namespace   aptcab   {

#define	N_NULL 	0xFFFFFFFF

struct  RecordLocation
{
public	:
    u_int32_t   fileno;
    u_int32_t   offset;
    u_int32_t   size;

public	:
	RecordLocation()
		: fileno(N_NULL),offset(N_NULL),size(N_NULL)
	{
	}

	void	set( u_int32_t fn, u_int32_t off, u_int32_t sz ) 
	{
		fileno = fn;
		offset = off;
		size = sz;
	}

	bool	is_null()
	{
		return (N_NULL == fileno) || (N_NULL == offset) || (N_NULL == size);
	}

	void	clear()
	{
		fileno = N_NULL;
		offset = N_NULL;
		size   = N_NULL;
	}

	bool	operator!=( const RecordLocation& rhs )
	{
		return !((fileno == rhs.fileno) && (offset == rhs.offset) && (size == rhs.size));
	}

	std::string	str()
	{
		std::ostringstream	msg;
		msg << "(" << fileno << "," << offset << "," << size << ")";
		return msg.str();
	}

};
typedef struct RecordLocation   RecordLocation;


}   //// namespace aptcab

#endif  ////    __APTCAB_RECORD_LOCATION_HPP_2010__

